<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->

<head>

    <!-- Basic Page Needs
  ================================================== -->
    <meta charset="utf-8">
    <title>10Hospital</title>
    <meta name="description" content="Free Responsive Html5 Css3 Templates | zerotheme.com">
    <meta name="author" content="www.zerotheme.com">

    <!-- Mobile Specific Metas
  ================================================== -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!-- CSS
  ================================================== -->
    <link rel="stylesheet" href="css/zerogrid.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/responsive.css">

    <script src="js/jquery.min.js"></script>
    <script>
        function over(obj) {
            obj.style.color = "#2196F3";
        }

        function out(obj) {
            obj.style.color = "aliceblue";
        }
        $(function() {
            $.get("header.html", function(data) {
                $("#header").html(data);
            });
            $.post('FindUserServlet', {}, function(data) {
                if (!data) {
                    location.href = "index.html";
                } else {
                    if (data.identity != 'patient') {
                        alert("无权访问");
                        location.href = "index.html";
                    } else {
                        var msg = data.username + "的个人中心";
                        $('#idName').html(msg);
                    }
                }
            });
            $.post('patientInfoServlet', {}, function(data) {
                $('#name').attr("value",data.username);
                $('#phone').attr("value",data.phone);
                $('#IDnumber').attr("value",data.idnumber);
            });
            $("#edit").click(function (e) {
                $("#edit").css("display","none");
                $("#submit").css("display","block");
                $("#IDnumber").removeAttr("readonly");
                $("#phone").removeAttr("readonly");
                $("#ff").submit(function () {
                    $.post("updatePatientServlet",$("#ff").serialize(),function (data) {
                        alert("更新完成");
                        setTimeout(function(){
                            location.href = "patient.html";
                        },2000);
                    });
                    return false;
                });
            })
        });
    </script>
    <!--[if lt IE 8]>
    <div style=' clear: both; text-align:center; position: relative;'>
        <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
            <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
        </a>
    </div>
    <![endif]-->
    <!--[if lt IE 9]>
    <script src="js/html5.js"></script>
    <script src="js/css3-mediaqueries.js"></script>
    <![endif]-->

</head>

<body id="archive">
    <div class="wrap-body">

        <!--////////////////////////////////////Header-->
        <div id="header">

        </div>


        <!--////////////////////////////////////Container-->
        <section id="container">
            <div class="wrap-container clearfix">
                <div class="zerogrid">
                    <div id="sidebar" class="col-1-3">
                        <div class="wrap-sidebar">
                            <div class="widget wid-about">
                                <div class="wid-header">
                                    <h5 id="idName"></h5>
                                </div>
                                <div class="wid-content">
                                    <br>
                                    <a href="#">个人资料</a>
                                    <br>
                                    <br>
                                    <a href="patient_record.html">查看电子病历</a>
                                    <br>
                                    <br>
                                    <a href="patient_medicine.html">查看药方</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="main-content" class="col-2-3">
                        <div class="wrap-content">
                            <div class="contact">
                                <h2>个人信息</h2>
                                <div id="contact_form">
                                    <form id="ff" method="post">
                                        <label>
                                        <span>姓名：</span>
                                        <input id="name" name="username" style="border:1px solid #DCDEE0; border-radius: 3px; background-color: white" readonly="readonly">
                                    </label>
                                        <label>
                                        <span>身份证号：</span>
                                        <input id="IDnumber" name="IDnumber" style="border:1px solid #DCDEE0; border-radius: 3px; background-color: white" readonly="readonly">
                                    </label>
                                        <label>
                                        <span>电话号码：</span>
                                        <input id="phone" name="phone" style="border:1px solid #DCDEE0; border-radius: 3px; background-color: white" readonly="readonly">
                                    </label>
                                    <center><input class="sendButton" type="button" id="edit" value="修改资料" style="display: block;"></center>
                                    <center><input class="sendButton" type="submit" id="submit" name="submit" value="确认修改" style="display: none;"></center>
                                    </form>
                                    <br><br><br><br><br>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <br>
        <br>
        <br>
        <!--////////////////////////////////////Footer-->
        <footer>
            <div class="bottom-footer">
                <div class="wrap-bottom ">
                    <div class="copyright">
                        <p>©2019 第十组医院</p>
                    </div>
                </div>
            </div>
        </footer>


    </div>
</body>

</html>